<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.10"/>
<title>ESP8266_RTOS_SDK: Mesh APIs</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<script type="text/javascript">
  $(document).ready(function() { init_search(); });
</script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td id="projectalign" style="padding-left: 0.5em;">
   <div id="projectname">ESP8266_RTOS_SDK
   &#160;<span id="projectnumber">v1.4.0</span>
   </div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.10 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script>
  <div id="navrow1" class="tabs">
    <ul class="tablist">
      <li><a href="index.html"><span>Main&#160;Page</span></a></li>
      <li><a href="modules.html"><span>Modules</span></a></li>
      <li><a href="annotated.html"><span>Data&#160;Structures</span></a></li>
      <li><a href="files.html"><span>Files</span></a></li>
      <li>
        <div id="MSearchBox" class="MSearchBoxInactive">
        <span class="left">
          <img id="MSearchSelect" src="search/mag_sel.png"
               onmouseover="return searchBox.OnSearchSelectShow()"
               onmouseout="return searchBox.OnSearchSelectHide()"
               alt=""/>
          <input type="text" id="MSearchField" value="Search" accesskey="S"
               onfocus="searchBox.OnSearchFieldFocus(true)" 
               onblur="searchBox.OnSearchFieldFocus(false)" 
               onkeyup="searchBox.OnSearchFieldChange(event)"/>
          </span><span class="right">
            <a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.png" alt=""/></a>
          </span>
        </div>
      </li>
    </ul>
  </div>
</div><!-- top -->
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

<div class="header">
  <div class="summary">
<a href="#enum-members">Enumerations</a> &#124;
<a href="#func-members">Functions</a>  </div>
  <div class="headertitle">
<div class="title">Mesh APIs</div>  </div>
</div><!--header-->
<div class="contents">

<p>Mesh APIs.  
<a href="#details">More...</a></p>
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="enum-members"></a>
Enumerations</h2></td></tr>
<tr class="memitem:ga73a6546355fa7461bbe09af0643c719e"><td class="memItemLeft" align="right" valign="top">enum &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__Mesh__APIs.html#ga73a6546355fa7461bbe09af0643c719e">mesh_status</a> { <br />
&#160;&#160;<a class="el" href="group__Mesh__APIs.html#gga73a6546355fa7461bbe09af0643c719ea34024c70dfdfac6cd104addcb7efdf4b">MESH_DISABLE</a> = 0, 
<a class="el" href="group__Mesh__APIs.html#gga73a6546355fa7461bbe09af0643c719eafc8893dffe37c367602bd732dd57277f">MESH_WIFI_CONN</a>, 
<a class="el" href="group__Mesh__APIs.html#gga73a6546355fa7461bbe09af0643c719eaf8707ddf897e616743134a1e28ed03f4">MESH_NET_CONN</a>, 
<a class="el" href="group__Mesh__APIs.html#gga73a6546355fa7461bbe09af0643c719ea2db29fbbb0d36ee854ddbf7325b4dbc0">MESH_LOCAL_AVAIL</a>, 
<br />
&#160;&#160;<a class="el" href="group__Mesh__APIs.html#gga73a6546355fa7461bbe09af0643c719ea3ed309a6fce09a48d29a668345170026">MESH_ONLINE_AVAIL</a>
<br />
 }<tr class="separator:ga73a6546355fa7461bbe09af0643c719e"><td class="memSeparator" colspan="2">&#160;</td></tr>
</td></tr>
<tr class="memitem:ga4947b8b90891b481b81383e08d45c346"><td class="memItemLeft" align="right" valign="top">enum &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__Mesh__APIs.html#ga4947b8b90891b481b81383e08d45c346">mesh_node_type</a> { <a class="el" href="group__Mesh__APIs.html#gga4947b8b90891b481b81383e08d45c346a8dc1197b5edf569a7e041845c7aae34e">MESH_NODE_PARENT</a> = 0, 
<a class="el" href="group__Mesh__APIs.html#gga4947b8b90891b481b81383e08d45c346ad1d85742ae6b9b121f3f5dc6f93827f4">MESH_NODE_CHILD</a>, 
<a class="el" href="group__Mesh__APIs.html#gga4947b8b90891b481b81383e08d45c346a95346a7d9886d3e5781fec75aff99ad7">MESH_NODE_ALL</a>
 }<tr class="separator:ga4947b8b90891b481b81383e08d45c346"><td class="memSeparator" colspan="2">&#160;</td></tr>
</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="func-members"></a>
Functions</h2></td></tr>
<tr class="memitem:ga3b2ebffff1527d4fb3fec86ab73c804b"><td class="memItemLeft" align="right" valign="top">bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__Mesh__APIs.html#ga3b2ebffff1527d4fb3fec86ab73c804b">espconn_mesh_local_addr</a> (struct ip_addr *ip)</td></tr>
<tr class="memdesc:ga3b2ebffff1527d4fb3fec86ab73c804b"><td class="mdescLeft">&#160;</td><td class="mdescRight">Check whether the IP address is mesh local IP address or not.  <a href="#ga3b2ebffff1527d4fb3fec86ab73c804b">More...</a><br /></td></tr>
<tr class="separator:ga3b2ebffff1527d4fb3fec86ab73c804b"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gacfa17fe9fe638da7cea59ff5f63e887e"><td class="memItemLeft" align="right" valign="top">bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__Mesh__APIs.html#gacfa17fe9fe638da7cea59ff5f63e887e">espconn_mesh_get_node_info</a> (enum <a class="el" href="group__Mesh__APIs.html#ga4947b8b90891b481b81383e08d45c346">mesh_node_type</a> type, uint8_t **info, uint8_t *count)</td></tr>
<tr class="memdesc:gacfa17fe9fe638da7cea59ff5f63e887e"><td class="mdescLeft">&#160;</td><td class="mdescRight">Get the information of mesh node.  <a href="#gacfa17fe9fe638da7cea59ff5f63e887e">More...</a><br /></td></tr>
<tr class="separator:gacfa17fe9fe638da7cea59ff5f63e887e"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gad6bb1d256497efb94543235414a1f7e5"><td class="memItemLeft" align="right" valign="top">bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__Mesh__APIs.html#gad6bb1d256497efb94543235414a1f7e5">espconn_mesh_encrypt_init</a> (<a class="el" href="group__WiFi__Common__APIs.html#ga49c8969263c0503dbe9811f16c500296">AUTH_MODE</a> mode, uint8_t *passwd, uint8_t passwd_len)</td></tr>
<tr class="memdesc:gad6bb1d256497efb94543235414a1f7e5"><td class="mdescLeft">&#160;</td><td class="mdescRight">Set WiFi cryption algrithm and password for mesh node.  <a href="#gad6bb1d256497efb94543235414a1f7e5">More...</a><br /></td></tr>
<tr class="separator:gad6bb1d256497efb94543235414a1f7e5"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga55a5712902986a0cfc4e57fbb7d34821"><td class="memItemLeft" align="right" valign="top">bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__Mesh__APIs.html#ga55a5712902986a0cfc4e57fbb7d34821">espconn_mesh_set_ssid_prefix</a> (uint8_t *prefix, uint8_t prefix_len)</td></tr>
<tr class="memdesc:ga55a5712902986a0cfc4e57fbb7d34821"><td class="mdescLeft">&#160;</td><td class="mdescRight">Set prefix of SSID for mesh node.  <a href="#ga55a5712902986a0cfc4e57fbb7d34821">More...</a><br /></td></tr>
<tr class="separator:ga55a5712902986a0cfc4e57fbb7d34821"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga4e2fd63e3eeaeba305b5ded90fcc753f"><td class="memItemLeft" align="right" valign="top">bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__Mesh__APIs.html#ga4e2fd63e3eeaeba305b5ded90fcc753f">espconn_mesh_set_max_hops</a> (uint8_t max_hops)</td></tr>
<tr class="memdesc:ga4e2fd63e3eeaeba305b5ded90fcc753f"><td class="mdescLeft">&#160;</td><td class="mdescRight">Set max hop for mesh network.  <a href="#ga4e2fd63e3eeaeba305b5ded90fcc753f">More...</a><br /></td></tr>
<tr class="separator:ga4e2fd63e3eeaeba305b5ded90fcc753f"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gad9db6b93cb1e3f37efdbb7a3e5180556"><td class="memItemLeft" align="right" valign="top">bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__Mesh__APIs.html#gad9db6b93cb1e3f37efdbb7a3e5180556">espconn_mesh_group_id_init</a> (uint8_t *grp_id, uint16_t gid_len)</td></tr>
<tr class="memdesc:gad9db6b93cb1e3f37efdbb7a3e5180556"><td class="mdescLeft">&#160;</td><td class="mdescRight">Set group ID of mesh node.  <a href="#gad9db6b93cb1e3f37efdbb7a3e5180556">More...</a><br /></td></tr>
<tr class="separator:gad9db6b93cb1e3f37efdbb7a3e5180556"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga7cb73ffe93d15bfe0bcc6c5d17bef4ac"><td class="memItemLeft" align="right" valign="top">bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__Mesh__APIs.html#ga7cb73ffe93d15bfe0bcc6c5d17bef4ac">espconn_mesh_set_dev_type</a> (uint8_t dev_type)</td></tr>
<tr class="memdesc:ga7cb73ffe93d15bfe0bcc6c5d17bef4ac"><td class="mdescLeft">&#160;</td><td class="mdescRight">Set the curent device type.  <a href="#ga7cb73ffe93d15bfe0bcc6c5d17bef4ac">More...</a><br /></td></tr>
<tr class="separator:ga7cb73ffe93d15bfe0bcc6c5d17bef4ac"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gaa00a7caa98b654fe5435f5990d99c06d"><td class="memItemLeft" align="right" valign="top">sint8&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__Mesh__APIs.html#gaa00a7caa98b654fe5435f5990d99c06d">espconn_mesh_connect</a> (struct <a class="el" href="structespconn.html">espconn</a> *usr_esp)</td></tr>
<tr class="memdesc:gaa00a7caa98b654fe5435f5990d99c06d"><td class="mdescLeft">&#160;</td><td class="mdescRight">Try to establish mesh connection to server.  <a href="#gaa00a7caa98b654fe5435f5990d99c06d">More...</a><br /></td></tr>
<tr class="separator:gaa00a7caa98b654fe5435f5990d99c06d"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga819e5e382bc1aaa254a347b2eb880250"><td class="memItemLeft" align="right" valign="top">sint8&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__Mesh__APIs.html#ga819e5e382bc1aaa254a347b2eb880250">espconn_mesh_disconnect</a> (struct <a class="el" href="structespconn.html">espconn</a> *usr_esp)</td></tr>
<tr class="memdesc:ga819e5e382bc1aaa254a347b2eb880250"><td class="mdescLeft">&#160;</td><td class="mdescRight">Disconnect a mesh connection.  <a href="#ga819e5e382bc1aaa254a347b2eb880250">More...</a><br /></td></tr>
<tr class="separator:ga819e5e382bc1aaa254a347b2eb880250"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gafec6034951b2c5cf70a7ea1c7707a03f"><td class="memItemLeft" align="right" valign="top">sint8&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__Mesh__APIs.html#gafec6034951b2c5cf70a7ea1c7707a03f">espconn_mesh_get_status</a> ()</td></tr>
<tr class="memdesc:gafec6034951b2c5cf70a7ea1c7707a03f"><td class="mdescLeft">&#160;</td><td class="mdescRight">Get current mesh status.  <a href="#gafec6034951b2c5cf70a7ea1c7707a03f">More...</a><br /></td></tr>
<tr class="separator:gafec6034951b2c5cf70a7ea1c7707a03f"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga8c60c7f53352f4e12bda09d0f2484075"><td class="memItemLeft" align="right" valign="top">sint8&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__Mesh__APIs.html#ga8c60c7f53352f4e12bda09d0f2484075">espconn_mesh_sent</a> (struct <a class="el" href="structespconn.html">espconn</a> *usr_esp, uint8 *pdata, uint16 len)</td></tr>
<tr class="memdesc:ga8c60c7f53352f4e12bda09d0f2484075"><td class="mdescLeft">&#160;</td><td class="mdescRight">Send data through mesh network.  <a href="#ga8c60c7f53352f4e12bda09d0f2484075">More...</a><br /></td></tr>
<tr class="separator:ga8c60c7f53352f4e12bda09d0f2484075"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga3dea1ef65bbb8c168082de273588c040"><td class="memItemLeft" align="right" valign="top">uint8&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__Mesh__APIs.html#ga3dea1ef65bbb8c168082de273588c040">espconn_mesh_get_max_hops</a> ()</td></tr>
<tr class="memdesc:ga3dea1ef65bbb8c168082de273588c040"><td class="mdescLeft">&#160;</td><td class="mdescRight">Get max hop of mesh network.  <a href="#ga3dea1ef65bbb8c168082de273588c040">More...</a><br /></td></tr>
<tr class="separator:ga3dea1ef65bbb8c168082de273588c040"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gab9f4efbcf201ac6b1425cf447485f7d8"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__Mesh__APIs.html#gab9f4efbcf201ac6b1425cf447485f7d8">espconn_mesh_enable</a> (espconn_mesh_callback enable_cb, enum mesh_type type)</td></tr>
<tr class="memdesc:gab9f4efbcf201ac6b1425cf447485f7d8"><td class="mdescLeft">&#160;</td><td class="mdescRight">To enable mesh network.  <a href="#gab9f4efbcf201ac6b1425cf447485f7d8">More...</a><br /></td></tr>
<tr class="separator:gab9f4efbcf201ac6b1425cf447485f7d8"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga130feda4a6e3a5e7ed1d750b6c4bc6ee"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__Mesh__APIs.html#ga130feda4a6e3a5e7ed1d750b6c4bc6ee">espconn_mesh_disable</a> (espconn_mesh_callback disable_cb)</td></tr>
<tr class="memdesc:ga130feda4a6e3a5e7ed1d750b6c4bc6ee"><td class="mdescLeft">&#160;</td><td class="mdescRight">To disable mesh network.  <a href="#ga130feda4a6e3a5e7ed1d750b6c4bc6ee">More...</a><br /></td></tr>
<tr class="separator:ga130feda4a6e3a5e7ed1d750b6c4bc6ee"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gacb87f54723aeacf3f4336eb1eb78633a"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__Mesh__APIs.html#gacb87f54723aeacf3f4336eb1eb78633a">espconn_mesh_init</a> ()</td></tr>
<tr class="memdesc:gacb87f54723aeacf3f4336eb1eb78633a"><td class="mdescLeft">&#160;</td><td class="mdescRight">To print version of mesh.  <a href="#gacb87f54723aeacf3f4336eb1eb78633a">More...</a><br /></td></tr>
<tr class="separator:gacb87f54723aeacf3f4336eb1eb78633a"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
<p>Mesh APIs. </p>
<h2 class="groupheader">Enumeration Type Documentation</h2>
<a class="anchor" id="ga4947b8b90891b481b81383e08d45c346"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">enum <a class="el" href="group__Mesh__APIs.html#ga4947b8b90891b481b81383e08d45c346">mesh_node_type</a></td>
        </tr>
      </table>
</div><div class="memdoc">
<table class="fieldtable">
<tr><th colspan="2">Enumerator</th></tr><tr><td class="fieldname"><a class="anchor" id="gga4947b8b90891b481b81383e08d45c346a8dc1197b5edf569a7e041845c7aae34e"></a>MESH_NODE_PARENT&#160;</td><td class="fielddoc">
<p>get information of parent node </p>
</td></tr>
<tr><td class="fieldname"><a class="anchor" id="gga4947b8b90891b481b81383e08d45c346ad1d85742ae6b9b121f3f5dc6f93827f4"></a>MESH_NODE_CHILD&#160;</td><td class="fielddoc">
<p>get information of child node(s) </p>
</td></tr>
<tr><td class="fieldname"><a class="anchor" id="gga4947b8b90891b481b81383e08d45c346a95346a7d9886d3e5781fec75aff99ad7"></a>MESH_NODE_ALL&#160;</td><td class="fielddoc">
<p>get information of all nodes </p>
</td></tr>
</table>

</div>
</div>
<a class="anchor" id="ga73a6546355fa7461bbe09af0643c719e"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">enum <a class="el" href="group__Mesh__APIs.html#ga73a6546355fa7461bbe09af0643c719e">mesh_status</a></td>
        </tr>
      </table>
</div><div class="memdoc">
<table class="fieldtable">
<tr><th colspan="2">Enumerator</th></tr><tr><td class="fieldname"><a class="anchor" id="gga73a6546355fa7461bbe09af0643c719ea34024c70dfdfac6cd104addcb7efdf4b"></a>MESH_DISABLE&#160;</td><td class="fielddoc">
<p>mesh disabled </p>
</td></tr>
<tr><td class="fieldname"><a class="anchor" id="gga73a6546355fa7461bbe09af0643c719eafc8893dffe37c367602bd732dd57277f"></a>MESH_WIFI_CONN&#160;</td><td class="fielddoc">
<p>WiFi connected </p>
</td></tr>
<tr><td class="fieldname"><a class="anchor" id="gga73a6546355fa7461bbe09af0643c719eaf8707ddf897e616743134a1e28ed03f4"></a>MESH_NET_CONN&#160;</td><td class="fielddoc">
<p>TCP connection OK </p>
</td></tr>
<tr><td class="fieldname"><a class="anchor" id="gga73a6546355fa7461bbe09af0643c719ea2db29fbbb0d36ee854ddbf7325b4dbc0"></a>MESH_LOCAL_AVAIL&#160;</td><td class="fielddoc">
<p>local mesh is avaliable </p>
</td></tr>
<tr><td class="fieldname"><a class="anchor" id="gga73a6546355fa7461bbe09af0643c719ea3ed309a6fce09a48d29a668345170026"></a>MESH_ONLINE_AVAIL&#160;</td><td class="fielddoc">
<p>online mesh is avaliable </p>
</td></tr>
</table>

</div>
</div>
<h2 class="groupheader">Function Documentation</h2>
<a class="anchor" id="gaa00a7caa98b654fe5435f5990d99c06d"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">sint8 espconn_mesh_connect </td>
          <td>(</td>
          <td class="paramtype">struct <a class="el" href="structespconn.html">espconn</a> *&#160;</td>
          <td class="paramname"><em>usr_esp</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Try to establish mesh connection to server. </p>
<dl class="section attention"><dt>Attention</dt><dd>If espconn_mesh_connect fail, returns non-0 value, there is no connection, so it won't enter any espconn callback.</dd></dl>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">struct</td><td>espconn *usr_esp : the network connection structure, the usr_esp to listen to the connection</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>0 : succeed </dd>
<dd>
Non-0 : error code<ul>
<li>ESPCONN_RTE - Routing Problem</li>
<li>ESPCONN_MEM - Out of memory</li>
<li>ESPCONN_ISCONN - Already connected</li>
<li>ESPCONN_ARG - Illegal argument, can't find the corresponding connection according to structure espconn </li>
</ul>
</dd></dl>

</div>
</div>
<a class="anchor" id="ga130feda4a6e3a5e7ed1d750b6c4bc6ee"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void espconn_mesh_disable </td>
          <td>(</td>
          <td class="paramtype">espconn_mesh_callback&#160;</td>
          <td class="paramname"><em>disable_cb</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>To disable mesh network. </p>
<dl class="section attention"><dt>Attention</dt><dd>When mesh network is disabed, the system will trigger disable_cb.</dd></dl>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">espconn_mesh_callback</td><td>disable_cb : callback function of mesh-disable </td></tr>
    <tr><td class="paramname">enum</td><td>mesh_type type : type of mesh, local or online.</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>null </dd></dl>

</div>
</div>
<a class="anchor" id="ga819e5e382bc1aaa254a347b2eb880250"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">sint8 espconn_mesh_disconnect </td>
          <td>(</td>
          <td class="paramtype">struct <a class="el" href="structespconn.html">espconn</a> *&#160;</td>
          <td class="paramname"><em>usr_esp</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Disconnect a mesh connection. </p>
<dl class="section attention"><dt>Attention</dt><dd>Do not call this API in any espconn callback. If needed, please use system task to trigger espconn_mesh_disconnect.</dd></dl>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">struct</td><td>espconn *usr_esp : the network connection structure</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>0 : succeed </dd>
<dd>
Non-0 : error code<ul>
<li>ESPCONN_ARG - illegal argument, can't find the corresponding TCP connection according to structure espconn </li>
</ul>
</dd></dl>

</div>
</div>
<a class="anchor" id="gab9f4efbcf201ac6b1425cf447485f7d8"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void espconn_mesh_enable </td>
          <td>(</td>
          <td class="paramtype">espconn_mesh_callback&#160;</td>
          <td class="paramname"><em>enable_cb</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">enum mesh_type&#160;</td>
          <td class="paramname"><em>type</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>To enable mesh network. </p>
<dl class="section attention"><dt>Attention</dt><dd>1. the function should be called in user_init. </dd>
<dd>
2. if mesh node can not scan the mesh AP, it will be isolate node without trigger enable_cb. user can use espconn_mesh_get_status to get current status of node. </dd>
<dd>
3. if user try to enable online mesh, but node fails to establish mesh connection the node will work with local mesh.</dd></dl>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">espconn_mesh_callback</td><td>enable_cb : callback function of mesh-enable </td></tr>
    <tr><td class="paramname">enum</td><td>mesh_type type : type of mesh, local or online.</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>null </dd></dl>

</div>
</div>
<a class="anchor" id="gad6bb1d256497efb94543235414a1f7e5"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">bool espconn_mesh_encrypt_init </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="group__WiFi__Common__APIs.html#ga49c8969263c0503dbe9811f16c500296">AUTH_MODE</a>&#160;</td>
          <td class="paramname"><em>mode</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">uint8_t *&#160;</td>
          <td class="paramname"><em>passwd</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">uint8_t&#160;</td>
          <td class="paramname"><em>passwd_len</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Set WiFi cryption algrithm and password for mesh node. </p>
<dl class="section attention"><dt>Attention</dt><dd>The function must be called before espconn_mesh_enable.</dd></dl>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">AUTH_MODE</td><td>mode : cryption algrithm (WPA/WAP2/WPA_WPA2). </td></tr>
    <tr><td class="paramname">uint8_t</td><td>*passwd : password of WiFi. </td></tr>
    <tr><td class="paramname">uint8_t</td><td>passwd_len : length of password (8 &lt;= passwd_len &lt;= 64).</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>true : succeed </dd>
<dd>
false : fail </dd></dl>

</div>
</div>
<a class="anchor" id="ga3dea1ef65bbb8c168082de273588c040"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">uint8 espconn_mesh_get_max_hops </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Get max hop of mesh network. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">null.</td><td></td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>the current max hop of mesh </dd></dl>

</div>
</div>
<a class="anchor" id="gacfa17fe9fe638da7cea59ff5f63e887e"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">bool espconn_mesh_get_node_info </td>
          <td>(</td>
          <td class="paramtype">enum <a class="el" href="group__Mesh__APIs.html#ga4947b8b90891b481b81383e08d45c346">mesh_node_type</a>&#160;</td>
          <td class="paramname"><em>type</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">uint8_t **&#160;</td>
          <td class="paramname"><em>info</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">uint8_t *&#160;</td>
          <td class="paramname"><em>count</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Get the information of mesh node. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">enum</td><td>mesh_node_type typ : mesh node type. </td></tr>
    <tr><td class="paramname">uint8_t</td><td>**info : the information will be saved in *info. </td></tr>
    <tr><td class="paramname">uint8_t</td><td>*count : the node count in *info.</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>true : succeed </dd>
<dd>
false : fail </dd></dl>

</div>
</div>
<a class="anchor" id="gafec6034951b2c5cf70a7ea1c7707a03f"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">sint8 espconn_mesh_get_status </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Get current mesh status. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">null</td><td></td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>the current mesh status, please refer to enum mesh_status. </dd></dl>

</div>
</div>
<a class="anchor" id="gad9db6b93cb1e3f37efdbb7a3e5180556"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">bool espconn_mesh_group_id_init </td>
          <td>(</td>
          <td class="paramtype">uint8_t *&#160;</td>
          <td class="paramname"><em>grp_id</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">uint16_t&#160;</td>
          <td class="paramname"><em>gid_len</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Set group ID of mesh node. </p>
<dl class="section attention"><dt>Attention</dt><dd>The function must be called before espconn_mesh_enable.</dd></dl>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">uint8_t</td><td>*grp_id : group ID. </td></tr>
    <tr><td class="paramname">uint16_t</td><td>gid_len: length of group ID, now gid_len = 6.</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>true : succeed </dd>
<dd>
false : fail </dd></dl>

</div>
</div>
<a class="anchor" id="gacb87f54723aeacf3f4336eb1eb78633a"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void espconn_mesh_init </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>To print version of mesh. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">null</td><td></td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>null </dd></dl>

</div>
</div>
<a class="anchor" id="ga3b2ebffff1527d4fb3fec86ab73c804b"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">bool espconn_mesh_local_addr </td>
          <td>(</td>
          <td class="paramtype">struct ip_addr *&#160;</td>
          <td class="paramname"><em>ip</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Check whether the IP address is mesh local IP address or not. </p>
<dl class="section attention"><dt>Attention</dt><dd>1. The range of mesh local IP address is 2.255.255.* ~ max_hop.255.255.*. </dd>
<dd>
2. IP pointer should not be NULL. If the IP pointer is NULL, it will return false.</dd></dl>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">struct</td><td>ip_addr *ip : IP address</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>true : the IP address is mesh local IP address </dd>
<dd>
false : the IP address is not mesh local IP address </dd></dl>

</div>
</div>
<a class="anchor" id="ga8c60c7f53352f4e12bda09d0f2484075"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">sint8 espconn_mesh_sent </td>
          <td>(</td>
          <td class="paramtype">struct <a class="el" href="structespconn.html">espconn</a> *&#160;</td>
          <td class="paramname"><em>usr_esp</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">uint8 *&#160;</td>
          <td class="paramname"><em>pdata</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">uint16&#160;</td>
          <td class="paramname"><em>len</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Send data through mesh network. </p>
<dl class="section attention"><dt>Attention</dt><dd>Please call espconn_mesh_sent after espconn_sent_callback of the pre-packet.</dd></dl>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">struct</td><td>espconn *usr_esp : the network connection structure </td></tr>
    <tr><td class="paramname">uint8</td><td>*pdata : pointer of data </td></tr>
    <tr><td class="paramname">uint16</td><td>len : data length</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>0 : succeed </dd>
<dd>
Non-0 : error code<ul>
<li>ESPCONN_MEM - out of memory</li>
<li>ESPCONN_ARG - illegal argument, can't find the corresponding network transmission according to structure espconn</li>
<li>ESPCONN_MAXNUM - buffer of sending data is full</li>
<li>ESPCONN_IF - send UDP data fail </li>
</ul>
</dd></dl>

</div>
</div>
<a class="anchor" id="ga7cb73ffe93d15bfe0bcc6c5d17bef4ac"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">bool espconn_mesh_set_dev_type </td>
          <td>(</td>
          <td class="paramtype">uint8_t&#160;</td>
          <td class="paramname"><em>dev_type</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Set the curent device type. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">uint8_t</td><td>dev_type : device type of mesh node</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>true : succeed </dd>
<dd>
false : fail </dd></dl>

</div>
</div>
<a class="anchor" id="ga4e2fd63e3eeaeba305b5ded90fcc753f"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">bool espconn_mesh_set_max_hops </td>
          <td>(</td>
          <td class="paramtype">uint8_t&#160;</td>
          <td class="paramname"><em>max_hops</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Set max hop for mesh network. </p>
<dl class="section attention"><dt>Attention</dt><dd>The function must be called before espconn_mesh_enable.</dd></dl>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">uint8_t</td><td>max_hops : max hop of mesh network (1 &lt;= max_hops &lt; 10, 4 is recommended).</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>true : succeed </dd>
<dd>
false : fail </dd></dl>

</div>
</div>
<a class="anchor" id="ga55a5712902986a0cfc4e57fbb7d34821"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">bool espconn_mesh_set_ssid_prefix </td>
          <td>(</td>
          <td class="paramtype">uint8_t *&#160;</td>
          <td class="paramname"><em>prefix</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">uint8_t&#160;</td>
          <td class="paramname"><em>prefix_len</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Set prefix of SSID for mesh node. </p>
<dl class="section attention"><dt>Attention</dt><dd>The function must be called before espconn_mesh_enable.</dd></dl>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">uint8_t</td><td>*prefix : prefix of SSID. </td></tr>
    <tr><td class="paramname">uint8_t</td><td>prefix_len : length of prefix (0 &lt; passwd_len &lt;= 22).</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>true : succeed </dd>
<dd>
false : fail </dd></dl>

</div>
</div>
</div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated on Tue Mar 1 2016 10:19:26 for ESP8266_RTOS_SDK by &#160;<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.8.10
</small></address>
</body>
</html>
